package com.demo.service;


import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.domain.Pageable;
import org.springframework.data.domain.Sort;
import org.springframework.stereotype.Service;

import com.demo.dao.EmployeeDao;
import com.demo.entity.Employee;

/**
 * @类名称：EmployeeService @类描述：
 * @创建人：YangChao
 * @创建时间：2017年9月13日 下午6:32:37
 * @version 1.0.0
 */
@Service("employeeService")
public class EmployeeService extends BaseService<Employee> {
	@Autowired
	private EmployeeDao employeeDao;

	public List<Employee> findByPhone(String phone){
		return employeeDao.findByPhone(phone);
	}
	
	public Employee findByEmail(String email){
		return employeeDao.findByEmail(email);
	}
	
	public Employee findByLoginName(String loginName){
		return employeeDao.findByLoginName(loginName);
	}
	
	public Employee findById(Long id){
		return employeeDao.findById(id);
	}
	
	public Employee findFirstByOrderById(){
		return employeeDao.findFirstByOrderById();
	}

	public Employee findTopByOrderByIdDesc(){
		return employeeDao.findTopByOrderByIdDesc();
	}

	public List<Employee> findFirst10ByName(String name, Sort sort){
		return employeeDao.findFirst10ByName(name, sort);
	}

	public List<Employee> findTop10ByName(String name, Pageable pageable){
		return employeeDao.findTop10ByName(name, pageable);
	}
	
}
